<template>
  <div>
    <van-nav-bar
      left-arrow
      :title="title"
      @click-right="onClickRight"
      @click-left="backHome"
      :right-text="rightText"
      :fixed="isFixed"
    >
      <!-- <template #right>
            <van-icon name="share" color="#808080" size="18" />
      </template>-->
    </van-nav-bar>
  </div>
</template>
<script>
export default {
  name: 'navBar',
  props: {
    title: {
      type: String,
      default: '',
    },
    rightText: {
      type: String,
      default: '',
    },
    backIndex: {
      type: Number,
      default: -1,
    },
    isFixed: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    backHome() {
      this.$router.go(this.backIndex)
    },
    onClickRight() {
      this.$emit('onClickRight')
    },
  },
}
</script>
